Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DotNetNuke
Imports DotNetNuke.UI.Utilities
Imports ModuleMasters.DNN.Modules.NCAAPoolStandings.Business

Namespace ModuleMasters.DNN.Modules.NCAAPoolBracket

    Public MustInherit Class NCAAPoolBracket

        Inherits Entities.Modules.PortalModuleBase
        Implements Entities.Modules.IActionable

#Region "Controls"
#End Region

#Region "Event Handlers"

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try

                ' Have not Set Options
                If IsNothing(Settings("PickCutoff")) Then
                    'Pool has not been setup
                    Me.lblDefault.Text = "Please Go to Setup Pool to Setup This Module."
                    Me.lblDefault.Visible = True
                    Me.lblDefault.ForeColor = System.Drawing.Color.Red
                    Me.lnkSubmitPicks.Visible = False
                    Me.lnkClearPicks.Visible = False
                    Me.pnlBracket.Visible = False
                    Return
                End If

                'TODO: postback is clearing the picks

                'REGISTER CLIENT API
                DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(Me.Page, DotNetNuke.UI.Utilities.ClientAPI.ClientNamespaceReferences.dnn)

                'load the javascript that contains the client side scripts for picks
                Dim jsFilePath As String = ResolveUrl("ClientScript.js")
                Me.Page.RegisterClientScriptBlock("ClientScript.js", "<script src='" + jsFilePath + "'></script>")

                If UserId > 0 Then

                    If Not Page.IsPostBack Then
                        'start loading the bracket
                        InitiateBracketLoad()
                    End If

                Else
                    'we are not authenticated, lets display a label
                    Me.lblDefault.Text = "You must be an authenticated user in order to make picks for this tournament."
                    Me.lblDefault.Visible = True
                    Me.lnkSubmitPicks.Visible = False
                    Me.lnkClearPicks.Visible = False
                    Me.pnlBracket.Visible = False
                End If

            Catch exc As Exception
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub

        Public Function RaiseClientAPICallbackEvent(ByVal eventArgument As String) As String 'Implements DotNetNuke.UI.Utilities.IClientAPICallbackEventHandler.RaiseClientAPICallbackEvent
            Return eventArgument
        End Function

        Public Sub FormatBracket()
            'This proc is used to format the bracket
            Dim c As Control
            For Each c In Me.FindControl("pnlBracket").Controls
                If Not c.ID Is Nothing Then
                    If c.ID.Substring(0, 2) = "id" Then
                        Dim txt As System.Web.UI.WebControls.TextBox
                        txt = CType(c, TextBox)
                        'If txt.ID = "id127" Then
                        'set a background color
                        'txt.BackColor = Color.Yellow
                        'End If
                        txt.ReadOnly = True
                        txt.Width = Unit.Pixel(100)
                        txt.Font.Name = "Tahoma"
                        txt.Font.Size = FontUnit.Point(8)
                        txt.BorderStyle = BorderStyle.Groove

                    End If
                End If
            Next
        End Sub

        Public Sub AddEvents()
            'This proc is used to add our javascript events for clicking 
            Dim c As Control
            For Each c In Me.FindControl("pnlBracket").Controls
                If Not c.ID Is Nothing Then
                    If c.ID.Substring(0, 2) = "id" Then
                        Dim txt As System.Web.UI.WebControls.TextBox
                        txt = CType(c, TextBox)
                        If txt.ID <> "id127" Then 'add onclick except final game
                            txt.Attributes.Add("onclick", "ChangePick(this.name,this.value,'" & Me.ClientID & "_')")
                            txt.Attributes.Add("onmouseover", "this.style.cursor='hand'")
                        End If

                    End If
                End If
            Next
        End Sub

        Public Sub LoadBracket(ByVal arrGamePredictions As ArrayList)
            'load the team into the appropriate bracket slot
            Dim objGamePrediction As GameInfo
            Dim i As Integer
            Dim lastGamePresent As Boolean = False
            For i = 0 To arrGamePredictions.Count - 1

                objGamePrediction = CType(arrGamePredictions(i), GameInfo)
                Dim c As Control
                For Each c In Me.FindControl("pnlBracket").Controls
                    If Not c.ID Is Nothing Then
                        If c.ID.Substring(0, 2) = "id" Then
                            Dim txt As System.Web.UI.WebControls.TextBox
                            txt = CType(c, TextBox)
                            If txt.ID = objGamePrediction.GameId Then
                                txt.Text = objGamePrediction.TeamName
                            End If

                            'Set the text of hidden controls
                            If CInt(c.ID.Substring(2, 3)) > 64 Then
                                Dim txthidden As System.Web.UI.HtmlControls.HtmlInputHidden
                                txthidden = Me.pnlBracket.FindControl("ih" & c.ID.Substring(2, 3))
                                txthidden.Value = txt.Text
                            End If

                        End If
                    End If
                Next

                'see if we are game 127
                If objGamePrediction.GameId = "id127" Then
                    lastGamePresent = True
                    Me.txtPredicted.Text = objGamePrediction.GameScore
                End If
            Next

            'if we didnt find the last game, there is no prediction on the score or the game
            If Not lastGamePresent Then
                Me.txtPredicted.Text = ""
            End If

        End Sub

        Public Sub LoadResults(ByVal arrGameResults As ArrayList)
            Dim objGameResult As GameInfo
            Dim i As Integer
            For i = 0 To arrGameResults.Count - 1
                objGameResult = CType(arrGameResults(i), GameInfo)
                Dim c As Control
                For Each c In Me.FindControl("pnlBracket").Controls
                    If Not c.ID Is Nothing Then
                        If c.ID.Substring(0, 2) = "id" Then
                            Dim txt As System.Web.UI.WebControls.TextBox
                            txt = CType(c, TextBox)
                            If txt.ID = objGameResult.GameId Then
                                'set the help text to identify the winner regardless of good pick or not
                                txt.ToolTip = objGameResult.TeamName
                                'now figure out if we picked right or not
                                If txt.Text = objGameResult.TeamName Then
                                    If CInt(objGameResult.GameId.Substring(2, 3)) > 64 Then
                                        'we picked right based on result
                                        txt.Font.Bold = True
                                        txt.Font.Strikeout = False
                                    End If
                                Else
                                    'we picked wrong, strickethrough current game
                                    txt.Font.Strikeout = True
                                    txt.Font.Bold = False
                                    UpdateWrongPicks(objGameResult.GameId.Substring(2, 3), txt.Text)
                                End If
                            End If
                            'if we are the last game, lets show the actual score in addition to the prediction
                            If txt.ID = "id127" And objGameResult.GameId = "id127" Then
                                Me.txtActualScore.Text = objGameResult.GameScore
                                Me.txtActualScore.Visible = True
                                Me.lblActualScore.Visible = True
                            End If
                        End If
                    End If
                Next
            Next

            'now we need to go through and gray out games that have no results
            Dim c2 As Control
            For Each c2 In Me.FindControl("pnlBracket").Controls
                If Not c2.ID Is Nothing Then
                    If c2.ID.Substring(0, 2) = "id" Then
                        Dim txt2 As System.Web.UI.WebControls.TextBox
                        txt2 = CType(c2, TextBox)
                        'now see if this gameid is in the results
                        Dim objGameResult2 As GameInfo
                        Dim found As Boolean = False
                        For Each objGameResult2 In arrGameResults
                            If objGameResult2.GameId = txt2.ID Then
                                found = True
                            End If
                        Next
                        If Not found Then
                            txt2.Enabled = False
                            txt2.Font.Bold = False
                        End If
                    End If
                End If
            Next

        End Sub

        Private Sub UpdateWrongPicks(ByVal GameId As Integer, ByVal ChosenWinner As String)
            'this procedure updates picks downstream that are wrong
            Dim b As Integer = Math.Ceiling(GameId / 2) + 64
            Dim c As Integer = Math.Ceiling(GameId / 4) + 96
            Dim d As Integer = Math.Ceiling(GameId / 8) + 112
            Dim e As Integer = Math.Ceiling(GameId / 16) + 120
            Dim f As Integer = Math.Ceiling(GameId / 32) + 124
            Dim g As Integer = Math.Ceiling(GameId / 64) + 126

            EvaluateFuturePick(b, ChosenWinner)
            EvaluateFuturePick(c, ChosenWinner)
            EvaluateFuturePick(d, ChosenWinner)
            EvaluateFuturePick(e, ChosenWinner)
            EvaluateFuturePick(f, ChosenWinner)
            EvaluateFuturePick(g, ChosenWinner)
        End Sub

        Private Sub EvaluateFuturePick(ByVal intGameId As Integer, ByVal ChosenWinner As String)
            'does the actual field comparision for updating wrong picks downstream
            If intGameId < 128 Then
                Dim ahead As TextBox = CType(Me.FindControl("id" & intGameId.ToString.PadLeft(3, "0")), TextBox)
                If Len(ahead.Text) > 0 Then 'we have a team, lets make sure it is set to winner
                    If ahead.Text = ChosenWinner Then
                        ahead.Font.Strikeout = True
                        ahead.Font.Bold = False
                    End If
                End If
            End If
        End Sub

        Private Sub ClearPicks()
            Dim c As Control
            For Each c In Me.FindControl("pnlBracket").Controls
                If Not c.ID Is Nothing Then
                    If c.ID.Substring(0, 2) = "id" Then
                        Dim txt As System.Web.UI.WebControls.TextBox
                        txt = CType(c, TextBox)
                        'see if we are > gameid 64
                        If CInt(c.ID.Substring(2, 3)) > 64 Then
                            txt.Text = ""
                            'Clear hidden text
                            Dim txthidden As System.Web.UI.HtmlControls.HtmlInputHidden
                            txthidden = Me.pnlBracket.FindControl("ih" & c.ID.Substring(2, 3))
                            txthidden.Value = ""
                        End If
                    End If
                End If
            Next
            'now clear the final score
            Me.txtPredicted.Text = ""
        End Sub

        Private Sub lnkSubmitPicks_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkSubmitPicks.Click
            'this will save a users pics to the DB, we will allow saving partial pics and will only score on what picks 
            'are there
            Dim GameController As New NCAAController

            'delete the previous picks
            GameController.DeleteUserPrediction(ModuleId, CInt(Me.lblViewUserId.Text))

            'for each control that is a game id, call the insertprediction
            Dim c As Control
            For Each c In Me.FindControl("pnlBracket").Controls
                If Not c.ID Is Nothing Then
                    If c.ID.Substring(0, 2) = "ih" Then
                        'make sure we are not the first 64 gameids
                        If CInt(c.ID.Substring(2, 3)) > 64 Then
                            Dim objGamePrediction As New GameInfo
                            Dim txt As System.Web.UI.HtmlControls.HtmlInputHidden
                            'Dim txt As System.Web.UI.WebControls.TextBox
                            txt = CType(c, HtmlInputHidden)
                            'set the values of the object
                            If txt.Value <> "" Or txt.ID = "ih127" Then
                                objGamePrediction.GameId = "id" & txt.ID.Substring(2, 3)

                                'if we are game 127, then we set the final score
                                If txt.ID = "ih127" And Me.txtPredicted.Text.Length > 0 Then
                                    objGamePrediction.GameScore = Me.txtPredicted.Text
                                End If

                                objGamePrediction.TeamName = txt.Value

                                'call the insert now
                                GameController.InsertUserPrediction(PortalId, ModuleId, CInt(Me.lblViewUserId.Text), objGamePrediction.GameId, objGamePrediction.TeamName, objGamePrediction.GameScore, objGamePrediction.TeamAScore, objGamePrediction.TeambScore)

                            End If
                        End If
                    End If
                End If
            Next

            'redirect back to portal
            Dim parms(2) As String
            parms(0) = "ViewUserId=" & Me.lblViewUserId.Text
            parms(1) = "ViewUserName=" & Me.lblViewUserName.Text
            Response.Redirect(NavigateURL(TabId, "", parms))

        End Sub

        Private Sub lnkClearPicks_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkClearPicks.Click
            'ClearPicks()
            Dim GameController As New NCAAController
            'delete the previous picks
            GameController.DeleteUserPrediction(ModuleId, CInt(Me.lblViewUserId.Text))
            'redirect back to portal
            Response.Redirect(NavigateURL())
        End Sub

        Private Sub InitiateBracketLoad()
            'this starts loading the bracket based off the user

            'figure out if the Userid was given to us via URL parm
            Dim ViewUserId As Integer
            Dim ViewUserName As String

            ViewUserId = CInt(Request.QueryString("ViewUserId"))
            ViewUserName = Request.QueryString("ViewUserName")

            'get the tourney date pick cutoff
            Dim PickCutoff As Date
            If Not Settings("PickCutoff") Is Nothing Then
                PickCutoff = CType(Settings("PickCutoff"), Date)
            Else
                PickCutoff = CType("3/19/2008 23:59", Date)
            End If

            'if the combo box is populated and different from query parm, then
            'go with the combobox
            If Not Me.cmbUsers.SelectedValue Is Nothing Then
                'we are a postback with a selection change, ignore query parm
                If Me.cmbUsers.SelectedValue.Length > 0 Then
                    ViewUserId = Me.cmbUsers.SelectedValue
                End If
            End If

            'if we have a viewuserid from combobox or from queryparm, use it
            If ViewUserId > 0 Then
                Me.lblViewUserId.Text = ViewUserId.ToString
                Me.lblViewUserName.Text = ViewUserName
                Me.lblUsers.Text = ViewUserName
                Me.lblPicksFor.Text = "Picks for "
            Else
                Me.lblViewUserId.Text = UserId.ToString
                Me.lblViewUserName.Text = UserInfo.FullName
                Me.lblUsers.Text = UserInfo.FullName
                Me.lblPicksFor.Text = "Picks for "
            End If

            'load the drop down list of users, set selected user next
            Dim arrUsers As ArrayList
            Dim PoolStandingsController As New NCAAPoolStandingsController
            arrUsers = PoolStandingsController.ListPoolStandings(PortalId, ModuleId)
            Me.cmbUsers.DataSource = arrUsers
            Me.cmbUsers.DataValueField = "UserId"
            Me.cmbUsers.DataTextField = "UserFirstLastName"
            If arrUsers.Count > 0 Then
                Me.cmbUsers.DataBind()
                'if user selected has no picks yet, don't try to find them in the combo
                If Not cmbUsers.Items.FindByValue(Me.lblViewUserId.Text) Is Nothing Then
                    cmbUsers.Items.FindByValue(Me.lblViewUserId.Text).Selected = True
                End If
            End If

            'see if we allow displaying drop down box for picks
            'we do if we are admin or now > pickdate
            Dim showUsers As Boolean = False
            If Now > PickCutoff Or Me.IsEditable Then
                showUsers = True
            End If

            'make visible the combobox or label
            If showUsers And arrUsers.Count > 0 And _
              Not cmbUsers.Items.FindByValue(Me.lblViewUserId.Text) Is Nothing Then
                Me.cmbUsers.Visible = True
                Me.lblUsers.Visible = False
            Else
                Me.cmbUsers.Visible = False
                Me.lblUsers.Visible = True
            End If

            'set the url for the show my picks and show it if looking at others picks
            Me.lnkMyPicks.NavigateUrl = NavigateURL()
            If UserId <> CInt(Me.lblViewUserId.Text) Then
                Me.lnkMyPicks.Visible = True
            Else
                Me.lnkMyPicks.Visible = False
            End If

            lnkClearPicks.Attributes.Add("onClick", "javascript:return confirm('Are you sure you want to clear these picks?');")

            Me.lblDefault.Visible = False
            Me.pnlBracket.Visible = True


            'declare some variables
            Dim ArrGameResult As ArrayList
            Dim ArrGamePredictions As ArrayList
            Dim GameController As New NCAAController

            'load the user picks or base games if that is all we have
            ArrGamePredictions = GameController.GetUserPicks(ModuleId, Me.lblViewUserId.Text)
            FormatBracket()
            LoadBracket(ArrGamePredictions)

            'now setup the events and show save options
            If Now() > PickCutoff Then
                'we are after the cutoff date, picks are not editable
                ArrGameResult = GameController.GetResults(ModuleId)
                LoadResults(ArrGameResult)
                Me.lnkSubmitPicks.Visible = False
                Me.lnkClearPicks.Visible = False
                Me.lblDefault.Visible = True
                Me.lblDefault.Text = "The pick cutoff date is past and the picks are read only now.  You will see your results as the results are recorded."
                Me.txtPredicted.ReadOnly = True
            Else
                'we can edit the picks
                Me.lblDefault.Text = "The pick cutoff date is set at " & PickCutoff.ToString & " all picks must be entered prior to this. The current server time is " & Now.ToString & "."
                Me.lblDefault.Visible = True
                'if userid <> viewuserid but we are admin we can edit picks
                If ((UserId <> CInt(Me.lblViewUserId.Text)) And Me.IsEditable) Or _
                    UserId = CInt(Me.lblViewUserId.Text) Then
                    AddEvents()
                    Me.lnkSubmitPicks.Visible = True
                    Me.lnkClearPicks.Visible = True
                Else
                    'we are looking at someone elses picks
                    Me.lnkSubmitPicks.Visible = False
                    Me.lnkClearPicks.Visible = False
                End If
            End If
        End Sub

        Private Sub cmbUsers_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbUsers.SelectedIndexChanged
            ClearPicks()
            InitiateBracketLoad()
        End Sub

#End Region

#Region "Optional Interfaces"
        Public ReadOnly Property ModuleActions() As Entities.Modules.Actions.ModuleActionCollection Implements Entities.Modules.IActionable.ModuleActions
            Get
                Dim Actions As New Entities.Modules.Actions.ModuleActionCollection
                Actions.Add(Getnextactionid, "Game Results", "NCAAResults", "", "", EditUrl("NCAAResults"), False, DotNetNuke.Security.SecurityAccessLevel.Edit, True, False)
                Actions.Add(GetNextActionID, Localization.GetString(Entities.Modules.Actions.ModuleActionType.AddContent, LocalResourceFile), Entities.Modules.Actions.ModuleActionType.AddContent, "", "", EditUrl(), False, DotNetNuke.Security.SecurityAccessLevel.Edit, True, False)
                Return Actions
            End Get
        End Property
#End Region

#Region " Web Form Designer Generated Code "

        'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

        End Sub


        Protected WithEvents id065 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id003 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id004 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id006 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id007 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id001 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id002 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id005 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id097 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id113 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id121 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id125 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id127 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id066 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id067 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id098 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id068 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id008 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id009 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id069 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id099 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id114 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id010 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id011 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id070 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id012 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id013 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id071 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id100 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id014 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id015 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id072 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id016 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id017 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id073 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id101 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id115 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id122 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id018 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id019 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id074 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id020 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id021 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id075 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id102 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id022 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id023 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id076 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id024 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id025 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id077 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id103 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id116 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id026 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id027 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id078 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id028 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id029 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id079 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id104 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id030 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id031 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id080 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id032 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id033 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id081 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id105 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id117 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id123 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id126 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id034 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id035 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id082 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id036 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id037 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id083 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id106 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id038 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id039 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id084 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id040 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id041 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id085 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id107 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id118 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id042 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id043 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id086 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id044 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id045 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id087 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id108 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id046 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id047 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id088 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id048 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id049 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id089 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id109 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id119 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id124 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id050 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id051 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id090 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id052 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id053 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id091 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id110 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id054 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id055 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id092 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id056 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id057 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id093 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id111 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id120 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id058 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id059 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id094 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id060 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id061 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id095 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id112 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id062 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id063 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id096 As System.Web.UI.WebControls.TextBox
        Protected WithEvents id064 As System.Web.UI.WebControls.TextBox
        Protected WithEvents lblDefault As System.Web.UI.WebControls.Label
        Protected WithEvents bracket As System.Web.UI.HtmlControls.HtmlGenericControl
        Protected WithEvents pnlBracket As System.Web.UI.WebControls.Panel
        Protected WithEvents txtPredicted As System.Web.UI.WebControls.TextBox
        Protected WithEvents txtActualScore As System.Web.UI.WebControls.TextBox
        Protected WithEvents lblPredictedScore As System.Web.UI.WebControls.Label
        Protected WithEvents lblActualScore As System.Web.UI.WebControls.Label
        Protected WithEvents lblCombinedScore As System.Web.UI.WebControls.Label
        Protected WithEvents lnkSubmitPicks As System.Web.UI.WebControls.LinkButton
        Protected WithEvents lnkClearPicks As System.Web.UI.WebControls.LinkButton
        Protected WithEvents ih065 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih066 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih067 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih068 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih069 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih070 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih071 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih072 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih073 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih074 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih075 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih076 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih077 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih078 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih079 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih080 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih081 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih082 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih083 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih084 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih085 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih086 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih087 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih088 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih089 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih090 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih091 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih092 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih093 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih094 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih095 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih096 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih097 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih098 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih099 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih100 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih101 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih102 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih103 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih104 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih105 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih106 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih107 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih108 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih109 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih110 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih111 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih112 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih113 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih114 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih115 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih116 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih117 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih118 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih119 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih120 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih121 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih122 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih123 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih124 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih125 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih126 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents ih127 As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents valTxtPredicted As System.Web.UI.WebControls.RegularExpressionValidator
        Protected WithEvents lblViewUserId As System.Web.UI.WebControls.Label
        Protected WithEvents lblViewUserName As System.Web.UI.WebControls.Label
        Protected WithEvents lblPicksFor As System.Web.UI.WebControls.Label
        Protected WithEvents lnkMyPicks As System.Web.UI.WebControls.HyperLink
        Protected WithEvents cmbUsers As System.Web.UI.WebControls.DropDownList
        Protected WithEvents lblUsers As System.Web.UI.WebControls.Label


        'NOTE: The following placeholder declaration is required by the Web Form Designer.
        'Do not delete or move it.
        Private designerPlaceholderDeclaration As System.Object

        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub

#End Region



    End Class

End Namespace
